<template>
  <div class="common-header">
    <div class="l-content">
      <el-button size="small" plain @click="handleCollapse">
        <el-icon :size="size">
          <Menu />
        </el-icon>
      </el-button>
    </div>
    <div class="r-content">
      <el-dropdown>
        <span class="el-dropdown-link">
          <img src="../assets/images/user.png" alt="" />
        </span>
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item>个人中心</el-dropdown-item>
            <el-dropdown-item>退出</el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown>
    </div>
  </div>
</template>
<script setup>
import { useCommonStateStore } from "../stores/counter.js";
const size = "20px";
const handleCollapse = () => {
  const store = useCommonStateStore();
  store.reverse();
  console.log("验证状态:", store.isCollapse);
};
</script>
<style scoped>
.el-dropdown img {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
}
.common-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}
</style>
